package org.example.gui.frame;

import org.example.gui.panel.MainPanel;

import javax.swing.*;
import java.util.Objects;

/**
 * 程序主窗体
 * 设置了程序窗体的长宽标题和退出操作等
 */
public class MainFrame extends JFrame {
    public static MainFrame instance = new MainFrame();

    private MainFrame() {
        this.setIconImage(new ImageIcon(Objects.requireNonNull(getClass().getResource("/org/example/img/logo/flower-96.png"))).getImage());
        this.setSize(520, 500);
        this.setTitle("记账本");
        this.setContentPane(MainPanel.instance);
        this.setLocationRelativeTo(null);
        this.setResizable(false);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
